<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Index</title>
  <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.1.min.js"></script>
</head>
<body>
<div id="app"></div>
<input type="button" onclick="btnClick()" value="get请求">
<input type="button" onclick="btnClick2()" value="post请求">

<script>
  function btnClick() {
    $.get('http://localhost:8081/hello', function (msg) {
      $("#app").html(msg);
    });
  }

  function btnClick2() {
    $.post('http://localhost:8081/hello', function (msg) {
      $("#app").html(msg);
    });
  }
</script>

</body>
</html>